/* 
 * BusinessService.java 02.10.2011
 *  
 *  
 * Candidate: Alessandra Otterbach
 * Prometric ID: Algisina1
 * Username: Algisina
 *  
 * Sun Certified Developer for Java 2 Platform, Standard Edition Programming 
 * Assignment (CX-310-252A)
 *  
 * This class is part of the Programming Assignment of the Sun Certified 
 * Developer for Java 2 Platform, Standard Edition certification program, must 
 * not be used out of this context and must be used exclusively by Sun 
 * Microsystems, Inc. 
 */
package suncertify.bs;

import java.rmi.RemoteException;
import java.util.List;
import java.util.Map;

import suncertify.dao.EnumSearchCriteria;
import suncertify.dao.RoomRecord;
import suncertify.db.DataException;
import suncertify.db.RecordNotFoundException;
import suncertify.db.RecordAlreadyBookedException;
import suncertify.db.SecurityException;

/**
 * Interface for the business methods.
 * 
 * @author Alessandra Otterbach
 * 
 */
public interface BusinessService {

    /**
     * Books a record with the specific record number. The records field "owner"
     * is set and the record will be updated.
     * 
     * @param recNo room number to be booked
     * @param room record data
     * @throws RecordNotFoundException
     * @throws SecurityException
     * @throws RemoteException
     * @throws RecordAlreadyBookedException
     * @throws DataException
     */
    void bookRoom(int recNo, RoomRecord room) throws RecordNotFoundException,
	    SecurityException, RemoteException, RecordAlreadyBookedException, DataException;

    /**
     * Searches for all records matching the given criterias. If the criterias
     * are empty, all records are given back.
     * 
     * @param searchCriterias
     * @return List of found records
     * @throws RecordNotFoundException
     * @throws DataException
     * @throws RemoteException
     */
    List<RoomRecord> searchRoom(Map<EnumSearchCriteria, String> searchCriterias)
	    throws RecordNotFoundException, DataException, RemoteException;
}
